<template>
  <!-- 大小额贷记退回查询明细-->
  <el-dialog :title="title" center :visible.sync="openState" width="1024px" :close-on-click-modal="false">
    <el-form ref="queryDetail" :model="form" label-width="110px" disabled >
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交易流水号" prop="id">
              <el-input v-model="form.id" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="报文标识号" prop="pkgId">
              <el-input v-model="form.pkgId" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="内部机构号" prop="brno">
              <el-select style="width: 100%" v-model="form.brno" placeholder="内部机构号">
                <el-option
                  v-for="dict in dictMap['Cnaps2Dict.CP2_BRNO']"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8" v-show="this.form.idPage !== 'HVPS'">
            <el-form-item label="明细标识号" prop="dtlNo">
              <el-input v-model="form.dtlNo" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="CPG日期" prop="cpgdate">
              <el-date-picker v-model="form.cpgdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker v-model="form.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select
                style="width: 100%"
                v-model="
                  form.bizTypeCode === null || form.bizTypeCode === undefined
                    ? ''
                    : form.bizTypeCode + '-' + form.bizTypeCodeDesc
                "
                placeholder="业务类型"

              ></el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select
                style="width: 100%"
                v-model="
                  form.bizCtgyCode === null || form.bizCtgyCode === undefined
                    ? ''
                    : form.bizCtgyCode + '-' + form.bizCtgyCodeDesc
                "
                placeholder="业务种类"

              ></el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="来往标识" prop="drct">
              <el-select style="width: 100%" v-model="form.drct" placeholder="来往标识">
                <el-option
                  v-for="dict in dictMap.DRCTCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务优先级" prop="bizProity">
              <el-select style="width: 100%" v-model="form.bizProity" placeholder="业务优先级">
                <el-option
                  v-for="dict in dictMap.PRIORITY3CODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="原交易流水号" prop="oriId">
              <el-input v-model="form.oriId" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="原报文标识号" prop="oriPkgId">
              <el-input v-model="form.oriPkgId" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="原报文类型" prop="oriMsgType">
              <el-select style="width: 100%;"
                         v-model="form.oriMsgType===null||form.oriMsgType===undefined?'':form.oriMsgType+'-'+form.oriMsgTypeDesc"
                         placeholder="原报文类型" :disabled="true"
              >
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-show="this.idPage!== 'HVPS'">
          <el-col :span="8">
            <el-form-item label="原明细标识号" prop="oriDtlNo">
              <el-input v-model="form.oriDtlNo" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="原业务类型" prop="oriBizType">
              <el-select style="width: 100%;"
                         v-model="form.oriBizType===null||form.oriBizType===undefined?'':form.oriBizType+'-'+form.oriBizTypeDesc"
                         placeholder="原业务类型" :disabled="true"
              >
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交易币种" prop="curcd">
              <el-input v-model="form.curcd" placeholder="货币种类"  />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="form.amount" placeholder="交易金额" ></ht-amount-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="大写金额" prop="bAmount">
              <ht-amount-upper :inputValue="form.amount" placeholder="交易金额"></ht-amount-upper>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--付款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="form.payerActno" placeholder="付款人账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款人名称" prop="payerName">
              <el-input v-model="form.payerName" placeholder="付款人名称" />
            </el-form-item>

          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款行行号" prop="payerBrno">
                <el-input v-model="form.payerBrno" placeholder="付款行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="付款行行名" prop="payerBrname" label-width="130px">
              <el-input v-model="form.payerBrname" placeholder="付款行行名" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款人开户行号" prop="payerAccBrno">
                <el-input v-model="form.payerAccBrno" placeholder="付款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="付款人开户行行名" prop="payerAccBrname" label-width="130px">
              <el-input v-model="form.payerAccBrname" placeholder="付款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--收款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="收款人账号" prop="payeeActno">
              <el-input v-model="form.payeeActno" placeholder="收款人账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款人名称" prop="payeeName">
              <el-input v-model="form.payeeName" placeholder="收款人名称" />
            </el-form-item>

          </el-col>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款行行号" prop="payeeBrno">
                <el-input v-model="form.payeeBrno" placeholder="收款行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款行行名" prop="payeeBrname" label-width="130px">
              <el-input v-model="form.payeeBrname" placeholder="收款行行名" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <el-input v-model="form.payeeAccBrno" placeholder="收款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrname" label-width="130px">
              <el-input v-model="form.payeeAccBrname" placeholder="收款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>其他信息</span>
        </div>
        <el-row>
          <el-row>
            <el-col :span="24">
              <el-form-item label="退汇原因" prop="txRemarks">
                <el-input type="textarea" v-model="form.txRemarks" />
              </el-form-item>
            </el-col>
          </el-row>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="录入操作员" prop="mdTlrno">
              <el-input v-model="form.mdTlrno"  />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="录入时间" prop="mdTime">
              <el-date-picker
                style="width: 100%"
                v-model="form.mdTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"

              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="审核附言" prop="audRemarks">
              <el-input type="textarea" v-model="form.audRemarks" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="审核操作员" prop="audTlrno">
              <el-input v-model="form.audTlrno"  />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="审核时间" prop="audTime">
              <el-date-picker
                style="width: 100%"
                v-model="form.audTime"
                value-format="yyyyMMddHHmmss"
                type="datetime"

              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="中心状态" prop="pbocStatus">
              <el-select style="width: 100%;" v-model="form.pbocStatus" placeholder="中心状态">
                <el-option
                  v-for="dict in dictMap.PROCESSSTATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="通讯状态" prop="status">
              <el-select style="width: 100%;" v-model="form.status" placeholder="通讯状态">
                <el-option
                  v-for="dict in dictMap.PKG_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="发送时间" prop="sndTime">
              <el-date-picker style="width: 100%;" v-model="form.sndTime" value-format="yyyyMMddHHmmss"
                              type="datetime"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="接收时间" prop="rcvTime">
              <el-date-picker style="width: 100%;" v-model="form.rcvTime" value-format="yyyyMMddHHmmss"
                              type="datetime"
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
        <el-col :span="12">
          <el-form-item label="业务处理码" prop="procCode">
            <el-select style="width: 100%;"
                       v-model="form.procCode===null||form.procCode===undefined?'':form.procCode+'-'+form.procCodeDesc"
                       placeholder="业务处理码" :disabled="true"
            >

            </el-select>
          </el-form-item>
        </el-col>

          <el-col :span="12">
            <el-form-item label="业务拒绝码" prop="rejectOrgCode">
              <el-select style="width: 100%;"
                         v-model="form.rejectOrgCode===null||form.rejectOrgCode===undefined?'':form.rejectOrgCode+'-'+form.rejectOrgCodeDesc"
                         placeholder="业务拒绝码" :disabled="true"
              >

              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="业务拒绝信息" prop="rejectInfo">
              <el-input type="textarea" v-model="form.rejectInfo" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { detail } from "@/api/cnaps/baseBiz/return/inquire/index";
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";

export default {
  name: "Detail",
  components: {
    HtAmountInput,
    HtAmountUpper,
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      cardList: [],
      busTypeList: [],
      id: "",
      title: "",
      msgType: "",
      // 是否显示弹出层
      openState: false,
      idPage: "",
      // 表单参数
      form: {
        amount: "0.00",
      },
    };
  },
  watch: {
    dictMap: {
      handler(data) {},
    },
  },
  async mounted() {
    let that = this;
  },
  methods: {
    // 表单重置
    reset() {
      // this.resetForm("editForm");
      this.$set(this, "form", {});
    },
    close() {
      this.openState = false;
    },
    show(id = "") {
      let that = this;
      this.id = id;
      this.title = "大小额贷记退汇查询明细";
      if (id) {
        // 如果传了ID 这里查询一个已经存在的数据
        detail({
          id: this.id,
        }).then((res) => {
          let tempForm = res.result.data;
          this.$set(this, "form", tempForm);
          this.idPage = res.result.id_Page;
          this.openState = true;
        });
      }
    },

    cancel() {
      this.openState = false;
      this.reset();
      this.$emit("editComplete", false);
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
